package com.didi.gulimall.config;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.HashSet;
import java.util.Set;

/**
 * @Author 10626
 * @Create 2021/6/10 11:22
 */
@Component()
public class RouteKeyConfig {
    private Set<String> wareRouteKet = new HashSet<>();

    private Set<String> memberRouteKet = new HashSet<>();

    private Set<String> orderRouteKet = new HashSet<>();

    private Set<String> cartRouteKet = new HashSet<>();
    @PostConstruct
    public void init() {
        wareRouteKet.add("order.release.#");
        wareRouteKet.add("order.paysuccess.#");

        memberRouteKet.add("order.release.#");
        memberRouteKet.add("order.paysuccess.#");

        orderRouteKet.add("order.create.order");
        orderRouteKet.add("order.rollback.order");

        cartRouteKet.add("order.release.#");
    }

    public Set<String> getWareRouteKet() {
        return wareRouteKet;
    }

    public Set<String> getMemberRouteKet() {
        return memberRouteKet;
    }

    public Set<String> getOrderRouteKet() {
        return orderRouteKet;
    }

    public Set<String> getCartRouteKet() {
        return cartRouteKet;
    }
}
